package com.niguang.work.api.enums;

import lombok.Getter;

@Getter
public enum DangerLevelEnum {

    ONE_LEVEL(1, "一般"),

    TWO_LEVEL(2, "较大"),

    THREE_LEVEL(3, "重大"),

    FOUR_LEVEL(4, "特大");

    private Integer index;

    private String desc;

    DangerLevelEnum(Integer index, String desc) {
        this.index = index;
        this.desc = desc;
    }


    public static String getName(Integer index) {
        for (DangerLevelEnum c : DangerLevelEnum.values()) {
            if (c.index.equals(index)) {
                return c.desc;
            }
        }
        return "";
    }
}
